import { request } from "../api/request";

export const getQueryFn = async ({ queryKey }) => {
  const { data } = await request(
    {
      url: queryKey[0],
      method: "get",
      data: queryKey[1].data ?? {},
      params: queryKey[1].params ?? {},
      headers: queryKey[1].headers ?? {},
    },
    queryKey[1].useToken ?? false
  );
  return {
    data,
  };
};
